package com.weixing.mall.provider.api.fallback;

import com.weixing.mall.base.orm.MPage;
import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.provider.api.model.dto.SaleAgentDto;
import com.weixing.mall.provider.api.model.query.AgentInfoQuery;
import com.weixing.mall.provider.api.model.vo.*;
import com.weixing.mall.provider.api.service.AgentServiceRpc;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: kfc
 * @Description: <br/>
 * Date:Create in 2019/8/5 15:24
 * @Modified By:
 */
@Component
public class AgentServieFallback implements AgentServiceRpc {


    @Override
    public Result<AgentVo> findByMobile(String mobile) {
        return null;
    }

    @Override
    public Result<AgentVo> selectByMobileOrSn(String searchParam) {
        return null;
    }

    @Override
    public Result<AgentVo> findByAgentSn(String agentSn) {
        return null;
    }

    @Override
    public Result<AgentRpcVo> selectByAgentSn(String agentSn) {

        return ResultUtil.error("代理商服务暂时不可用");
    }

    @Override
    public Result<AgentRpcVo> selectByAgentMobile(String mobile) {
        return ResultUtil.error("代理商服务暂时不可用");
    }

    @Override
    public Result<AgentVo> findByAgentInfo(AgentInfoQuery agentInfoQuery) {
        return null;
    }

    @Override
    public Result<AgentCustomerVo> selectByIdAgentCustomer(Long agentId) {
        return null;
    }

    @Override
    public List<AgentVo> selectByParentId(Long agentId) {
        return null;
    }

    @Override
    public Result<AgentVo> selectById(Long agentId) {
        return ResultUtil.error("服务暂不可用");
    }

    @Override
    public List<Long> selectByCustomerIdAgentLevel(int parseInt, long currentUserId) {
        return null;
    }

    @Override
    public List<Long> selectAgentIdByAgentLevel(int agentLevel) {
        return null;
    }

    @Override
    public Result<AgentRpcVo> selectByAgentId(Long agentId) {
        return ResultUtil.error("代理商服务暂时不可用");
    }

    @Override
    public Long[] selectAgentTreeByParentId(Long agentId) {
        return new Long[0];
    }

    @Override
    public List<AgentCustomerVo> selectByCustomerId(Long customerId) {
        return null;
    }

    @Override
    public Result<AgentAuthVo> selectAuthVoByLoginName(String loginName) {
        return ResultUtil.error("代理商服务暂时不可用");
    }

    @Override
    public Result<AgentDiscountVo> selectActDiscount(Long id) {
        return ResultUtil.error("代理商服务暂时不可用");
    }

    @Override
    public Result<AgentRebateRuleInfoVo> selectActRebateRule(Long ruleId, Integer ruleCode) {
        return ResultUtil.error("代理商服务暂时不可用");
    }

    @Override
    public Result<AgentBonusRuleVo> selectBonusRule(Integer orderType) {
        return ResultUtil.error("代理商服务暂时不可用");
    }

    @Override
    public Result<MPage<AgentRpcVo>> selectChildByAgentId(long currentPage, long pageSize, long agentId) {
        return ResultUtil.error("代理商服务暂时不可用");
    }

    @Override
    public Result<MPage<AgentRpcVo>> selectChildByKefuId(long currentPage, long pageSize, long kefuId) {
//        throw  new BusinessException("什么鬼错误");
        return ResultUtil.error("代理商服务暂时不可用");
    }

    @Override
    public Result updateMobile( Long agentId,String mobile) {
        return ResultUtil.error("代理商服务暂时不可用");
    }

    @Override
    public void updateTradeDate(Long agentId, String today) {

    }

    @Override
    public Result upgradeMsgTask() {
        return ResultUtil.error("代理商服务暂时不可用");
    }

    @Override
    public Result expireTask() {
        return ResultUtil.error("代理商服务暂时不可用");
    }

    @Override
    public Result<MPage<AgentRpcVo>> selectChildByAgent(SaleAgentDto saleAgentDto) {
        throw new RuntimeException();
//        return ResultUtil.error("代理商服务暂时不可用");
    }
}
